<?php
    include './base.php';

    $username = $_POST['username'];
    $password = $_POST['password'];

    $sql = "SELECT * FROM `user` WHERE `username`='$username' AND `password`='$password'";

    $res = $conn->query($sql);

    $row = $res->fetch_assoc();

    if ($row) {
        echo '{"msg": "登陆成功", "code": 0}';
    } else {
        echo '{"msg": "用户名或者密码错误", "code": 1}';
    }
?>